console.log(11111);
const arr = [1, 2, 3, 4, 5, 6]
const map = (array, fn) => {
  const results = []
  for (const key of array) {
    results.push(fn(key))
  }
  return results
}

console.log(map(arr, item => item * item));

const every = (array, fn) => {
  let result = true
  for (const key of array) {
    if (!fn(key)) {
      return !result
    }
  }
  return result
}


const some = (array, fn) => {
  let result = false
  for (const key of array) {
    if (fn(key)) {
      return !result
    }
  }
  return result
}
console.log(every(arr, v => v > 0));
console.log(some(arr, v => v > 5));


